#!/bin/bash
mkdir ~/lab1
mkdir ~/lab1/test #1
ls -AlX ~ > ~/lab1/test/list #2
mkdir ~/lab1/test/links #3
ln ~/lab1/test/list ~/lab1/test/links/list_link #4
rm ~/lab1/test/list #5
cat ~/lab1/test/links/list_link | cowsay -s -n #6
ls -lR /etc 2>/dev/null | grep -s [.]conf$ | tr '\n' ';' > ~/lab1/test/list_conf #7  #find /etc -name *.conf -type f > list_conf
ls -ld /etc/* 2>/dev/null | grep -s [.]d$ | tr '\n' ';' > ~/lab1/test/list_d #8 #find /etc -name *.d -type d > list_d
cat ~/lab1/test/list_conf ~/lab1/test/list_d > ~/lab1/test/list_conf_d #9
ln -s ~/lab1/test/list_conf_d ~/lab1/test/links/list_conf_d_link #10
less ~/lab1/test/links/list_conf_d_link #11
mkdir ~/lab1/test/.sub #12
cp ~/lab1/test/list_conf_d ~/lab1/test/.sub/ #13
cp -b ~/lab1/test/list_conf_d ~/lab1/test/.sub/ #14
mv ~/lab1/test/.sub/list_conf_d ~/lab1/test/.sub/list_etc #15
rm ~/lab1/test/list_conf_d #16
cat ~/lab1/test/links/list_conf_d_link #17
cal -y 2010 > ~/lab1/test/calendar.txt #18
head -n 10 ~/lab1/test/calendar.txt #19
find ~/lab1/test/ #20
rm -rf ~/lab1/test/ #21